package demo1225.am;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/*
BufferedOutputStream类
缓冲字节输出流
public BufferedOutputStream(OutputStream os);
常用的方法:
1.public void write(int c);把字节写入到输出流中.
2.public void write(byte[] bs);把字节数组写入到输出流中.
 */
public class Demo_04 {
    public static void main(String[] args) {
        try (BufferedOutputStream bos = new BufferedOutputStream
                             (new FileOutputStream("a.txt"))) {

            bos.write("中国加油".getBytes());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
